﻿<%@ Page Language="C#" AutoEventWireup="true" Theme="Default" CodeBehind="LaiHanWJLB.aspx.cs" Inherits="Web.Pages.YongShui._13.LAIHANGL.LAIHANWJLB" %>

<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>文件列表</title>
    <script type="text/javascript" src="../../../JS/AddEditCancel.js"></script>
    <script type="text/javascript" src="../../../JS/jquery.js"></script>
    <script type="text/javascript" src="../../../JS/jquery-1.11.1.min.js"></script>
    <script type="text/javascript">
        function OpenWin(url) {
            var w = screen.availWidth - 10;
            var h = screen.availHeight - 50;
            window.open(url, ''
        , 'width='+w+',height='+h+'left=0,top=0,resizable=yes,toolbar=no,menubar=no,scrollbars=yes,status=no,location=no');
        }
        //20190327 添加修改文件功能 begin ********************************
        //文件上传完成后刷新文件列表
        function Uploader_OnFilesUploadComplete(args) {
            gvWenJian.PerformCallback();
        }
        //材料下拉列表改变后设置
        function ComboBoxGetSelectIndex() {
            hdCollection.Set("cllb", cmbCaiLiaoLB.GetValue());
            hdCollection.Set("cllbmc", cmbCaiLiaoLB.GetText());
        }
        //后台回调完成
        function ASPxCallback1Complete(rs) {
        }
        //打开高拍
        function OpenGaoPai() {
            if (Number(cmbCaiLiaoLB.GetValue()) <= -1) {
                alert("请选择材料类别");
                cmbCaiLiaoLB.Focus();
                return;
            }
            openCenterGaoPai("/Pages/YongShui/13.LAIHANGL/GAOPAIUPLOAD.aspx?wtype=" + hdCollection.Get("wtype") +
                "&urltype=LH&yonghuh=" + hdCollection.Get("yonghuh") +
                "&laihanbh=" + hdCollection.Get("laihanbh") +
                "&index=" + cmbCaiLiaoLB.GetSelectedIndex() +
                "&txtvalue=" + escape(cmbCaiLiaoLB.GetValue()) +
                "&txtname=" + escape(cmbCaiLiaoLB.GetText()),
                "700px",
                "550px");
        }
        function openCenterGaoPai(openUrl, iWidth, iHeight) {
            var iTop = 0; //(window.screen.availHeight - 45 - iHeight) / 2; //获得窗口的垂直位置;
            var iLeft = 0; // (window.screen.availWidth - 10 - iWidth) / 2; //获得窗口的水平位置;
            window.open(openUrl, '', 'width=700,height=600');
        }
        //20190327 添加修改文件功能 end ********************************
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <dx:ASPxHiddenField ID="hdCollection" ClientInstanceName="hdCollection" runat="server"></dx:ASPxHiddenField>
        <dx:ASPxCallback ID="ASPxCallback1" ClientInstanceName="ASPxCallback1" runat="server" OnCallback="ASPxCallback1_Callback" ClientSideEvents-CallbackComplete="function(s,e){ASPxCallback1Complete(e.result);}"></dx:ASPxCallback>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <div>
                </div>
                <dx:ASPxGridView ID="gvWenJian" ClientInstanceName="gvWenJian" runat="server" AutoGenerateColumns="False" KeyFieldName="ID" Theme="Aqua1" Width="100%" 
                    OnCustomCallback="gvWenJian_CustomCallback">
                    <Columns>
                        <dx:GridViewDataTextColumn Caption="序号" Width="35px" CellStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
                            <DataItemTemplate>
                                <%#Container.ItemIndex+1 %>
                            </DataItemTemplate>
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn FieldName="S_WENJIANMC" CellStyle-HorizontalAlign="Center" Caption="文件名称" HeaderStyle-HorizontalAlign="Center"></dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="查看" CellStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
                            <DataItemTemplate>
                                <a href="javascript:OpenWin('<%#Eval("S_WENJIANLJ") %>')">查看文件</a>
                            </DataItemTemplate>
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Width="35px" Caption="删除">
                            <DataItemTemplate>
                                <asp:LinkButton ID="lnbDel" runat="server" CausesValidation="false"  Text="删除" OnClientClick="return confirm('确认删除吗？')" CommandArgument='<%#Eval("ID")%>' OnCommand="lnbDel_Command"></asp:LinkButton>
                            </DataItemTemplate>
                        </dx:GridViewDataTextColumn>
                    </Columns>
                    <SettingsBehavior AllowSort="false" />
                    <Settings VerticalScrollableHeight="250" VerticalScrollBarMode="Auto" />
                </dx:ASPxGridView>
                <div id="divUpload" style="margin-top: 10px;" runat="server">
                    <table id="table" style="width: 100%">
                        <tr>
                            <td style="float:right;margin-top:4px;margin-right:5px">
                                <dx:ASPxComboBox ID="cmbCaiLiaoLB" ClientInstanceName="cmbCaiLiaoLB" runat="server" Width="270px" ValueType="System.String">
                                    <ClientSideEvents SelectedIndexChanged="function(s,e){ComboBoxGetSelectIndex()}"/>
                                </dx:ASPxComboBox>
                            </td>
                            <td style="width: 50px">
                                <dx:ASPxButton ID="BtnGP" AutoPostBack="false" runat="server" Style="margin-right: 5px;" UseSubmitBehavior="false" Text="高拍">
                                    <ClientSideEvents Click="function(s,e){OpenGaoPai()}"/>
                                </dx:ASPxButton>
                            </td>
                            <td style="width: 60px">
                                <dx:ASPxUploadControl ID="UpLoadFile" runat="server" ClientInstanceName="uploader" ShowTextBox="false" Theme="Aqua" UploadMode="Standard" ShowClearFileSelectionButton="False"
                                    ShowProgressPanel="True" NullText="" OnFileUploadComplete="UpLoadFile_FileUploadComplete" Width="0px">
                                    <BrowseButton Text="上传"></BrowseButton>
                                    <ClientSideEvents FilesUploadComplete="function(s, e) { Uploader_OnFilesUploadComplete(s,e); }" 
                                        TextChanged="function(s, e) { uploader.Upload();}">
                                    </ClientSideEvents>
                                    <ValidationSettings MaxFileSize="4194304">
                                    </ValidationSettings>
                                </dx:ASPxUploadControl>
                            </td>
                        </tr>
                    </table>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
</body>
</html>
